//
//  AppManager.h
//  HealthKitDemo
//
//  Created by LZP on 2018/9/3.
//  Copyright © 2018年 鹏鹏. All rights reserved.
//

#import "DBTool.h"
#import "Singleton.h"
#import "SectionRecordModel.h"
#import <YYModel.h>

@interface AppManager : DBTool

singleton_interface(AppManager)

NSDateFormatter *timeFormatter(NSString *dateFormat);
NSDateFormatter *defaultTimeFormatter(void);
NSString *currentDateString(void);

NSString *databaseName(void);
- (NSString *)checkDBExits;
- (void)checkTablesNeeded;

- (NSString *)documentPath;

// 测试用的清空表数据
- (void)deleteAllCaches;

- (void)addSingleRecordWithRecordTime:(NSString *)recordTime deviceName:(NSString *)deviceName count:(int)count completeHandler:(void(^)(BOOL result))completeHandler;

- (void)queryAllSectRecordBeforeTime:(NSString *)currentTime WithStatus:(BOOL)updated completeHandler:(void(^)(NSArray <SectionRecordModel *>*results))completeHandler;

- (void)updateSectionRecord:(SectionRecordModel *)model WithStatus:(BOOL)updated completeHandler:(void(^)(BOOL result))completeHandler;

- (void)queryDataFrom:(NSString *)startTime to:(NSString *)endTime status:(BOOL)updated completeHandler:(void(^)(NSArray <SectionRecordModel *> *results))completeHandler;
@end
